package tech.aistar.day05.statics;

/**
 * 本类用来演示:
 *
 * @author: success
 * @date: 2022/7/22 2:58 下午
 */
public class StaticOuter {//外部类

    private int id = 10;

    private static int guid = 100;

    //静态内部类
    public static class StaticInner{
        //private int id=100;

        private static int guid=200;

        public void test(){
           // System.out.println("id:"+id);

            //允许直接访问外部类中的静态属性
            System.out.println("inner-guid:"+guid);

            //如果内部类中也有同名的,需要通过外部类.静态属性访问
            System.out.println("outer-guid:"+ StaticOuter.guid);
        }
    }
}
class TestStaticOuter{
    public static void main(String[] args) {
        StaticOuter.StaticInner s = new StaticOuter.StaticInner();
        s.test();
    }
}
